/**
 * <copyright>
 * Copyrigth 2007 Aurelien Moreau
 *
 * This file is part of ProcessShop.
 *
 * ProcessShop is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * ProcessShop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with ProcessShop; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * </copyright>
 *
 * $Id$
 */
package net.yienyien.process.bpel.generator.impl;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import net.yienyien.process.bpd.BPDObject;
import net.yienyien.process.bpd.IntermediateEvent;
import net.yienyien.process.bpel.generator.Production;

import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.Operation;
import org.eclipse.wst.wsdl.WSDLFactory;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.AbstractFactory;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.TActivity;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.TInvoke;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.TOnMessage;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.TPartnerLink;
import org.open.oasis.docs.wsbpel._2._0.process.abstract_.TProcess;

public class ProductionImpl implements Production {
	
	private TProcess process;
	private Operation operation;
	private Definition processWsdl;
	private Set<Definition> wsdls;
	
	private Map<BPDObject, Object>                  activityMappings;
	private Map<IntermediateEvent, TOnMessage>         iEventMappings;
	
	//private Map<String, Map<Definition, TPartnerLink>> partnerBindings;
	
	private Map<Object, Operation>                    operationBindings;
	
	
	
	public ProductionImpl() {
		this.process=AbstractFactory.eINSTANCE.createTProcess();
	}
	
	public Map<BPDObject, Object> getTaskMappings() {
		if(activityMappings==null) {
			activityMappings=new HashMap<BPDObject, Object>();
		}
		return activityMappings;
	}

	public TProcess getProcess() {
		return process;
	}
	
	public Set<Definition> getWSDLs() {
		if(wsdls==null) {
			wsdls=new HashSet<Definition>();
		}
		return wsdls;
	}
	
	public void setProcessWSDL(Definition processWsdl) {
		this.processWsdl=processWsdl;
	}
	
	public Definition getProcessWSDL() {
		return processWsdl;
	}
	
	public Map<Object, Operation> getOperationBindings() {
		if(operationBindings==null) {
			operationBindings=new HashMap<Object, Operation>();
		}
		return operationBindings;
	}

	@Override
	public void setTargetOperation(Operation op) {
		this.operation=op;
	}
	
	@Override
	public Operation getTargetOperation() {
		return operation;
	}


	
}
